package com.meituan.provider;

import com.meituan.model.ReplyEntity;
import org.apache.ibatis.jdbc.SQL;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ReplyProvider {

    public String insert(ReplyEntity replyEntity){
        SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" );
        String current = sdf.format(new Date());
        return new SQL(){
            {
                INSERT_INTO("reply");
                VALUES("order_id","#{orderId}");
                VALUES("evaluation_id","#{evaluationId}");
                VALUES("shop_id","#{shopId}");
                VALUES("reply_content","#{replyContent}");
                VALUES("reply_time","'"+current+"'");
            }
        }.toString();
    }
}
